"use strict"

/**
 * 河北省公共资源交易中心爬虫
 *  json
 */

var Base = require("./base");
var jx_spider = new Base();
jx_spider.name = "河北省公共资源交易中心";
this.contentType = "json"; // html, text, 

jx_spider.getPageUrl = function(pg) {
    return "http://www.hebpr.cn/fulltextsearch/rest/getfulltextdata?format=json&wd=%E6%B2%B3%E5%8C%97&sdt=&edt=&idx_cgy=&sort=0&rmk4=&pn="+ pg +"&rn=10&cl=150";

};

jx_spider.getItems = function($) {
    var items = [];
    $(".frame-con-link").each(function(index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text().substring(40,115);
        item.url = "http://www.hebpr.cn"+e.attr("href");
        item.source = jx_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = jx_spider;